package com.lq.rocketmq.consumer.listener;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName Consumer
 * @Description 消息监听器 需要实现RocketMQListener,可以指定消息类型
 * @Author LQ
 * @Date 2021/5/22 0:34
 * @Version 1.0
 */
@Component
@RocketMQMessageListener(topic = "springboot-rocketmq", consumerGroup = "${rocketmq.producer.group}")
public class Consumer implements RocketMQListener<String> {
    @Override
    public void onMessage(String s) {
        System.out.println("接收到消息:" + s);
    }
}
